# ifndef __Transform_H_
# define __Transform_H_

struct point_t;

class CTransformationBase {
  public:
	virtual void ApplyTo (point_t & _point) const = 0;
};

class C2WayTransformation {
  public:
	C2WayTransformation (CTransformationBase * _pTo, CTransformationBase * _pReverse) :
		m_pTo (_pTo),
		m_pReverse (_pReverse)
	{}
	~C2WayTransformation () {
		delete m_pTo;
		delete m_pReverse;
	}

	// Reverse transformation.
	void ApplyTo (point_t & _point) const {
		if (m_pTo)
			m_pTo->ApplyTo (_point);
	}
	void Reverse (point_t & _point) const {
		if (m_pReverse)
			m_pReverse->ApplyTo (_point);
	}

	CTransformationBase * const m_pTo, * const m_pReverse;
};

# endif //  __Transform_H_